package com.just.recruitback.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.just.recruitback.entity.Company;
import com.just.recruitback.entity.Job;
import com.just.recruitback.model.PageInfo;
import com.just.recruitback.model.Screen;
import com.just.recruitback.service.JobService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author baibaiwuchang
 * @since 2020-07-02
 */
@RestController
@RequestMapping("/job")
public class JobController {
    @Resource
    private JobService jobService;

    @GetMapping("/list")
    public Page<Job> getJobsByCompany(int companyId, int count, int size) {
        return jobService.getJobsByCompany(companyId, new PageInfo(count, size));
    }

    @GetMapping("/one")


    public Job getCompany(int jobId) {
        return jobService.getOne(jobId);
    }

    @PostMapping("/find")
    public List<Job> findJobs() {
        return jobService.findJobs();
    }

    @PostMapping("/screen")
    public Page<Job> screenJob(@RequestBody Screen screen) {
        return jobService.screenJob(screen);
    }
}
